﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using grounding.parser;
using grounding.nao;
using grounding.nao.sensors;

namespace grounding.grounder
{
    /// <summary>
    /// A Grounder should be a semi-supervised learner (not sure if that's really
    /// the right description) that takes in as data a list of sensor frames and
    /// classifies it into some logic term.
    /// </summary>
    public interface IGrounder
    {
        /// <summary>
        /// Fully Supervised training, overwrites previously learned models.
        /// </summary>
        /// <param name="data">Data to train on</param>
        void Train(List<TrainingData> data);

        /// <summary>
        /// Uses new training examples to update learned models.
        /// </summary>
        /// <param name="data">Data to update models with</param>
        void ReTrain(List<TrainingData> data);

        /// <summary>
        /// Classifies a sensor frame.
        /// </summary>
        /// <param name="frame">Frame to classify</param>
        /// <returns>A dictionary mapping from the logicElement label to a confidence value</returns>
        Dictionary<ILogicElement, double> Test(double[] frame);
    }
}
